package com.myCode.entity;

import java.math.BigDecimal;

public class Product {
    private Integer id;
    private String productName;
    private Integer dir_id;
    private BigDecimal salPrice;
    private String supplier;
    private String brand;
    private BigDecimal cutoff;
    private BigDecimal costPrice;
    private String create_time;
    private String edit_time;

    //jsp页面中的通过EL表达式根据指定字段对应的get方法
    // 获取参数值可以自定义指定的get方法根据分类编号显示指定的分类名称

    public String getDir_name(){
        if (dir_id!=null){
            if (dir_id==101){
                return "普通鼠标";
            }else if (dir_id==102){
                return "102鼠标";
            }else if (dir_id==103){
                return "103鼠标";
            }else if (dir_id==104){
                return "104鼠标";
            }else if (dir_id==105){
                return "105鼠标";
            }else if (dir_id==201){
                return "201鼠标";
            }else if (dir_id==202){
                return "202鼠标";
            }else {
                return "203鼠标";
            }
        }
        return "";
    }

    public Product(Integer id, String productName, Integer dir_id, BigDecimal salPrice, String supplier, String brand, BigDecimal cutoff, BigDecimal costPrice) {
        this.id = id;
        this.productName = productName;
        this.dir_id = dir_id;
        this.salPrice = salPrice;
        this.supplier = supplier;
        this.brand = brand;
        this.cutoff = cutoff;
        this.costPrice = costPrice;
    }

    @Override
    public String toString() {
        return "Product{" +
                "id=" + id +
                ", productName='" + productName + '\'' +
                ", dir_id=" + dir_id +
                ", salPrice=" + salPrice +
                ", supplier='" + supplier + '\'' +
                ", brand='" + brand + '\'' +
                ", cutoff=" + cutoff +
                ", costPrice=" + costPrice +
                ", create_time='" + create_time + '\'' +
                ", edit_time='" + edit_time + '\'' +
                '}';
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getProductName() {
        return productName;
    }

    public void setProductName(String productName) {
        this.productName = productName;
    }

    public Integer getDir_id() {
        return dir_id;
    }

    public void setDir_id(Integer dir_id) {
        this.dir_id = dir_id;
    }

    public BigDecimal getSalPrice() {
        return salPrice;
    }

    public void setSalPrice(BigDecimal salPrice) {
        this.salPrice = salPrice;
    }

    public String getSupplier() {
        return supplier;
    }

    public void setSupplier(String supplier) {
        this.supplier = supplier;
    }

    public String getBrand() {
        return brand;
    }

    public void setBrand(String brand) {
        this.brand = brand;
    }

    public BigDecimal getCutoff() {
        return cutoff;
    }

    public void setCutoff(BigDecimal cutoff) {
        this.cutoff = cutoff;
    }

    public BigDecimal getCostPrice() {
        return costPrice;
    }

    public void setCostPrice(BigDecimal costPrice) {
        this.costPrice = costPrice;
    }

    public String getCreate_time() {
        return create_time;
    }

    public void setCreate_time(String create_time) {
        this.create_time = create_time;
    }

    public String getEdit_time() {
        return edit_time;
    }

    public void setEdit_time(String edit_time) {
        this.edit_time = edit_time;
    }

    public Product() {
    }
}